﻿using System;
using CodingDojo.Domain.KataAlarmClock;
using Machine.Specifications;

namespace CodingDojo.Domain.Spec.KataAlarmClock
{
  public class With_Two_Alarms_Ready_To_Be_Used
  {
    private Establish context = () =>
                                  {
                                    _repository = MakeRepository();
                                    _alarmsManager = new AlarmsManager(_repository);
                                  };

    private static AlarmRepository MakeRepository()
    {
      _alarm = new Alarm(101, new TimeSpan(7, 0, 0), string.Empty);
      _alarmTwo = new Alarm(102, new TimeSpan(9, 0, 0), string.Empty);
      var repository = new AlarmRepository();
      repository.Add(_alarm);
      repository.Add(_alarmTwo);
      return repository;
    }

    protected static Alarm _alarm;
    protected static Alarm _alarmTwo;
    protected static AlarmRepository _repository;
    protected static AlarmsManager _alarmsManager;
  }
}
